/*
 * SVMClass.h
 *
 *  Created on: Dec 23, 2013
 *      Author: thanhkm
 */

#ifndef SVMCLASS_H_
#define SVMCLASS_H_

#include <iostream>
#include <math.h>
#include <string>
#include "opencv2/opencv.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/ml/ml.hpp"


class Learning {
public:
	Learning();
	virtual ~Learning();

	void train(cv::Mat& trainingData, cv::Mat& trainingClasses);
	void predict(cv::Mat& data, cv::Mat& responses);
	static void convertToMat(std::vector<int> vecLabels, cv::Mat &matLabels);
	static void evaluate(cv::Mat& predicted, cv::Mat& actual);
	static void evaluate2(cv::Mat& predicted, cv::Mat& actual);
private:
	// SVM training
	CvSVM svm;
};

#endif /* SVMCLASS_H_ */
